package com.hyb.algorithm.data.struct.tree.segment;

/**
 *  线段树
 * @author: ybhu
 * @create: 2024/11/05 07:44
 */
public class SegmentTree<E> {


    private E[] data;

    private E[] treeData;

    private Merger merger;

    public SegmentTree(E[] srcData,Merger merger){
        this.merger=merger;

        this.data=(E[])new Object[srcData.length];

        for(int i=0;i<srcData.length;i++){
            data[i]=srcData[i];
        }

        this.treeData=(E[])new Object[4*srcData.length];

    }

    public int getSize(){
        return data.length;
    }

    public E get(int index){

        if(index<0||index>data.length){
            throw new IllegalArgumentException("index out range!");
        }
        return data[index];
    }

    private   void builderSegmentTree(){

    }
}
